// 局点自定义逻辑加载定制js文件
import { getHelpManualBaseUrl } from '@/components/common/help-manual/help-manual-util.js';

const CustomerLoader = {

  /*
   * 加载局点定制js
   * 局点对应js文件放在 /public/help-manual/costomer-diy/costomer-diy.js
   */
  loadCustomerJs() {
    // 体优一体dac转换
    if (!window.xVueWeb.app.config.globalProperties.dacTransDataFormat) {
      return false;
    }

    window.CustomerDiy = {}; // 初始化全局对象
    const baseUrl = getHelpManualBaseUrl();
    const jsUrl = `${baseUrl}/customer-diy/customer-diy.js`;
    const script = document.createElement('script');
    script.src = jsUrl;
    document.head.appendChild(script);
    return true;
  },
};

setTimeout(() => {
  CustomerLoader.loadCustomerJs();
}, 500);
